{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "# 读取 Excel 文件\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "def generate_city_26():\n",
    "    df = pd.read_excel('./data/中国各城市空间权重矩阵(1).xlsx', sheet_name='地理距离矩阵')\n",
    "    provinces = df.iloc[:, 0].values\n",
    "    # citys = df.iloc[:, 1].values\n",
    "    # matrix = df.iloc[0:, 3:].values\n",
    "    distance_matrix = df.iloc[:, 3:]\n",
    "    city_index = 2\n",
    "    distance_matrix.index = df.iloc[:, city_index].values\n",
    "    distance_matrix.columns = df.iloc[:, city_index].values\n",
    "\n",
    "    # 挑选出安徽、江苏、浙江和上海的省份及对应的矩阵数据\n",
    "    selected_provinces = ['Anhui', 'Jiangsu', 'Zhejiang', 'Shanghai']\n",
    "    # selected_cities = df[df['proveng'].isin(selected_provinces)]['cityeng'].tolist()\n",
    "    selected_indices = [i for i, prov in enumerate(provinces) if prov in selected_provinces]\n",
    "    # selected_matrix = matrix[selected_indices, :]\n",
    "    selected_indices_str = df.values[selected_indices, city_index]\n",
    "    # 从城市列表中随机选择25个城市（不包括上海）\n",
    "    selected_index = pd.Index(selected_indices_str)\n",
    "    # 使用 loc 方法选择相应的行和列\n",
    "    selected_data = distance_matrix.loc[selected_index, selected_index]\n",
    "    np.random.seed(42)\n",
    "    # print(selected_indices_str[0])\n",
    "    random_cities = np.random.choice(selected_indices_str[1:], 25, replace=False)\n",
    "    # print(len(random_cities))\n",
    "    # 将上海添加到随机选择的城市列表中 \n",
    "    # City158 = shanghai\n",
    "    selected_cities_26 = ['City158'] + random_cities.tolist()\n",
    "    print(len(selected_cities_26))\n",
    "    selected_index_26 = pd.Index(selected_cities_26)\n",
    "    # 使用 loc 方法选择相应的行和列\n",
    "\n",
    "\n",
    "    selected_data_26 = selected_data.loc[selected_index_26, selected_index_26]\n",
    "    city_to_city_series = df[['cityeng', 'cityseries']].drop_duplicates().set_index('cityeng')['cityseries'].to_dict()\n",
    "    city_series_to_city = df[['cityeng', 'cityseries']].drop_duplicates().set_index('cityseries')['cityeng'].to_dict()\n",
    "    city_series_26_columns = selected_data_26.columns\n",
    "    city_26_columns = []\n",
    "    for item in city_series_26_columns:\n",
    "        city_26_columns.append(city_series_to_city[item])\n",
    "    city_26 = pd.DataFrame(selected_data_26.values, index=city_26_columns, columns=city_26_columns)\n",
    "    return city_26"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "def read_init_state():\n",
    "    df = pd.read_excel('./data/数据.xlsx', sheet_name='initial state')\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "26\n"
     ]
    },
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Shanghai</th>\n",
       "      <th>Zhoushan</th>\n",
       "      <th>Shaoxing</th>\n",
       "      <th>Huzhou</th>\n",
       "      <th>Maanshan</th>\n",
       "      <th>Nantong</th>\n",
       "      <th>ningbo</th>\n",
       "      <th>chizou</th>\n",
       "      <th>Huaibei</th>\n",
       "      <th>Lianyungang</th>\n",
       "      <th>...</th>\n",
       "      <th>zhenjiang</th>\n",
       "      <th>Jinhua</th>\n",
       "      <th>Bengbu</th>\n",
       "      <th>Nanjing</th>\n",
       "      <th>Suzhou</th>\n",
       "      <th>huaian</th>\n",
       "      <th>Hangzhou</th>\n",
       "      <th>Wuxi</th>\n",
       "      <th>Anqing</th>\n",
       "      <th>Lishui</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>Shanghai</th>\n",
       "      <td>0.00</td>\n",
       "      <td>145.84</td>\n",
       "      <td>156.19</td>\n",
       "      <td>136.34</td>\n",
       "      <td>288.14</td>\n",
       "      <td>121.87</td>\n",
       "      <td>180.37</td>\n",
       "      <td>392.51</td>\n",
       "      <td>527.73</td>\n",
       "      <td>412.91</td>\n",
       "      <td>...</td>\n",
       "      <td>219.81</td>\n",
       "      <td>294.22</td>\n",
       "      <td>416.88</td>\n",
       "      <td>286.05</td>\n",
       "      <td>508.59</td>\n",
       "      <td>317.38</td>\n",
       "      <td>157.76</td>\n",
       "      <td>107.97</td>\n",
       "      <td>418.88</td>\n",
       "      <td>361.50</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Zhoushan</th>\n",
       "      <td>145.84</td>\n",
       "      <td>0.00</td>\n",
       "      <td>165.81</td>\n",
       "      <td>200.50</td>\n",
       "      <td>394.74</td>\n",
       "      <td>267.26</td>\n",
       "      <td>89.17</td>\n",
       "      <td>461.78</td>\n",
       "      <td>660.70</td>\n",
       "      <td>558.70</td>\n",
       "      <td>...</td>\n",
       "      <td>354.13</td>\n",
       "      <td>278.94</td>\n",
       "      <td>541.62</td>\n",
       "      <td>410.45</td>\n",
       "      <td>640.24</td>\n",
       "      <td>461.82</td>\n",
       "      <td>189.52</td>\n",
       "      <td>233.06</td>\n",
       "      <td>486.19</td>\n",
       "      <td>312.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Shaoxing</th>\n",
       "      <td>156.19</td>\n",
       "      <td>165.81</td>\n",
       "      <td>0.00</td>\n",
       "      <td>63.84</td>\n",
       "      <td>253.38</td>\n",
       "      <td>224.34</td>\n",
       "      <td>109.58</td>\n",
       "      <td>297.58</td>\n",
       "      <td>540.29</td>\n",
       "      <td>499.18</td>\n",
       "      <td>...</td>\n",
       "      <td>256.08</td>\n",
       "      <td>138.50</td>\n",
       "      <td>412.11</td>\n",
       "      <td>288.48</td>\n",
       "      <td>517.98</td>\n",
       "      <td>385.97</td>\n",
       "      <td>29.18</td>\n",
       "      <td>149.95</td>\n",
       "      <td>321.41</td>\n",
       "      <td>207.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Huzhou</th>\n",
       "      <td>136.34</td>\n",
       "      <td>200.50</td>\n",
       "      <td>63.84</td>\n",
       "      <td>0.00</td>\n",
       "      <td>197.79</td>\n",
       "      <td>171.30</td>\n",
       "      <td>165.46</td>\n",
       "      <td>267.15</td>\n",
       "      <td>479.52</td>\n",
       "      <td>436.86</td>\n",
       "      <td>...</td>\n",
       "      <td>192.27</td>\n",
       "      <td>173.90</td>\n",
       "      <td>353.07</td>\n",
       "      <td>226.77</td>\n",
       "      <td>457.54</td>\n",
       "      <td>322.75</td>\n",
       "      <td>40.26</td>\n",
       "      <td>92.00</td>\n",
       "      <td>292.75</td>\n",
       "      <td>255.49</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Maanshan</th>\n",
       "      <td>288.14</td>\n",
       "      <td>394.74</td>\n",
       "      <td>253.38</td>\n",
       "      <td>197.79</td>\n",
       "      <td>0.00</td>\n",
       "      <td>220.80</td>\n",
       "      <td>361.66</td>\n",
       "      <td>150.08</td>\n",
       "      <td>292.61</td>\n",
       "      <td>335.04</td>\n",
       "      <td>...</td>\n",
       "      <td>120.45</td>\n",
       "      <td>283.55</td>\n",
       "      <td>161.33</td>\n",
       "      <td>68.93</td>\n",
       "      <td>269.52</td>\n",
       "      <td>221.65</td>\n",
       "      <td>224.21</td>\n",
       "      <td>180.83</td>\n",
       "      <td>173.31</td>\n",
       "      <td>372.19</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Nantong</th>\n",
       "      <td>121.87</td>\n",
       "      <td>267.26</td>\n",
       "      <td>224.34</td>\n",
       "      <td>171.30</td>\n",
       "      <td>220.80</td>\n",
       "      <td>0.00</td>\n",
       "      <td>288.06</td>\n",
       "      <td>356.50</td>\n",
       "      <td>416.00</td>\n",
       "      <td>292.72</td>\n",
       "      <td>...</td>\n",
       "      <td>117.50</td>\n",
       "      <td>344.43</td>\n",
       "      <td>316.51</td>\n",
       "      <td>193.49</td>\n",
       "      <td>398.46</td>\n",
       "      <td>195.78</td>\n",
       "      <td>209.62</td>\n",
       "      <td>80.86</td>\n",
       "      <td>382.50</td>\n",
       "      <td>426.66</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>ningbo</th>\n",
       "      <td>180.37</td>\n",
       "      <td>89.17</td>\n",
       "      <td>109.58</td>\n",
       "      <td>165.46</td>\n",
       "      <td>361.66</td>\n",
       "      <td>288.06</td>\n",
       "      <td>0.00</td>\n",
       "      <td>402.42</td>\n",
       "      <td>644.67</td>\n",
       "      <td>578.45</td>\n",
       "      <td>...</td>\n",
       "      <td>349.14</td>\n",
       "      <td>194.88</td>\n",
       "      <td>518.50</td>\n",
       "      <td>391.65</td>\n",
       "      <td>622.82</td>\n",
       "      <td>471.49</td>\n",
       "      <td>138.50</td>\n",
       "      <td>230.70</td>\n",
       "      <td>425.02</td>\n",
       "      <td>223.14</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>chizou</th>\n",
       "      <td>392.51</td>\n",
       "      <td>461.78</td>\n",
       "      <td>297.58</td>\n",
       "      <td>267.15</td>\n",
       "      <td>150.08</td>\n",
       "      <td>356.50</td>\n",
       "      <td>402.42</td>\n",
       "      <td>0.00</td>\n",
       "      <td>362.14</td>\n",
       "      <td>473.87</td>\n",
       "      <td>...</td>\n",
       "      <td>269.30</td>\n",
       "      <td>251.38</td>\n",
       "      <td>241.65</td>\n",
       "      <td>214.35</td>\n",
       "      <td>339.34</td>\n",
       "      <td>366.35</td>\n",
       "      <td>272.30</td>\n",
       "      <td>296.58</td>\n",
       "      <td>26.51</td>\n",
       "      <td>322.16</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Huaibei</th>\n",
       "      <td>527.73</td>\n",
       "      <td>660.70</td>\n",
       "      <td>540.29</td>\n",
       "      <td>479.52</td>\n",
       "      <td>292.61</td>\n",
       "      <td>416.00</td>\n",
       "      <td>644.67</td>\n",
       "      <td>362.14</td>\n",
       "      <td>0.00</td>\n",
       "      <td>258.24</td>\n",
       "      <td>...</td>\n",
       "      <td>308.19</td>\n",
       "      <td>572.67</td>\n",
       "      <td>131.94</td>\n",
       "      <td>253.09</td>\n",
       "      <td>23.49</td>\n",
       "      <td>245.23</td>\n",
       "      <td>511.65</td>\n",
       "      <td>427.81</td>\n",
       "      <td>366.59</td>\n",
       "      <td>658.70</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Lianyungang</th>\n",
       "      <td>412.91</td>\n",
       "      <td>558.70</td>\n",
       "      <td>499.18</td>\n",
       "      <td>436.86</td>\n",
       "      <td>335.04</td>\n",
       "      <td>292.72</td>\n",
       "      <td>578.45</td>\n",
       "      <td>473.87</td>\n",
       "      <td>258.24</td>\n",
       "      <td>0.00</td>\n",
       "      <td>...</td>\n",
       "      <td>250.96</td>\n",
       "      <td>589.50</td>\n",
       "      <td>266.37</td>\n",
       "      <td>266.13</td>\n",
       "      <td>257.18</td>\n",
       "      <td>118.00</td>\n",
       "      <td>476.91</td>\n",
       "      <td>351.01</td>\n",
       "      <td>491.41</td>\n",
       "      <td>679.22</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>yancheng</th>\n",
       "      <td>258.08</td>\n",
       "      <td>403.60</td>\n",
       "      <td>359.28</td>\n",
       "      <td>300.56</td>\n",
       "      <td>261.47</td>\n",
       "      <td>140.59</td>\n",
       "      <td>428.66</td>\n",
       "      <td>411.55</td>\n",
       "      <td>337.74</td>\n",
       "      <td>155.95</td>\n",
       "      <td>...</td>\n",
       "      <td>145.01</td>\n",
       "      <td>466.61</td>\n",
       "      <td>278.14</td>\n",
       "      <td>201.52</td>\n",
       "      <td>326.11</td>\n",
       "      <td>92.58</td>\n",
       "      <td>340.64</td>\n",
       "      <td>209.49</td>\n",
       "      <td>434.46</td>\n",
       "      <td>553.44</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Huainan</th>\n",
       "      <td>466.32</td>\n",
       "      <td>584.13</td>\n",
       "      <td>444.70</td>\n",
       "      <td>389.36</td>\n",
       "      <td>191.73</td>\n",
       "      <td>372.37</td>\n",
       "      <td>553.34</td>\n",
       "      <td>230.22</td>\n",
       "      <td>133.97</td>\n",
       "      <td>322.40</td>\n",
       "      <td>...</td>\n",
       "      <td>254.91</td>\n",
       "      <td>455.20</td>\n",
       "      <td>62.83</td>\n",
       "      <td>181.09</td>\n",
       "      <td>112.43</td>\n",
       "      <td>256.58</td>\n",
       "      <td>415.52</td>\n",
       "      <td>359.15</td>\n",
       "      <td>233.10</td>\n",
       "      <td>537.71</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Taizhou</th>\n",
       "      <td>210.06</td>\n",
       "      <td>350.13</td>\n",
       "      <td>267.14</td>\n",
       "      <td>204.21</td>\n",
       "      <td>153.52</td>\n",
       "      <td>96.94</td>\n",
       "      <td>353.52</td>\n",
       "      <td>302.26</td>\n",
       "      <td>319.74</td>\n",
       "      <td>232.93</td>\n",
       "      <td>...</td>\n",
       "      <td>33.07</td>\n",
       "      <td>359.84</td>\n",
       "      <td>220.82</td>\n",
       "      <td>106.11</td>\n",
       "      <td>301.81</td>\n",
       "      <td>119.01</td>\n",
       "      <td>244.11</td>\n",
       "      <td>122.82</td>\n",
       "      <td>326.35</td>\n",
       "      <td>448.61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wenzhou</th>\n",
       "      <td>359.15</td>\n",
       "      <td>275.66</td>\n",
       "      <td>221.57</td>\n",
       "      <td>281.23</td>\n",
       "      <td>431.87</td>\n",
       "      <td>445.42</td>\n",
       "      <td>191.49</td>\n",
       "      <td>401.86</td>\n",
       "      <td>723.42</td>\n",
       "      <td>717.44</td>\n",
       "      <td>...</td>\n",
       "      <td>468.98</td>\n",
       "      <td>153.25</td>\n",
       "      <td>591.50</td>\n",
       "      <td>484.59</td>\n",
       "      <td>700.10</td>\n",
       "      <td>601.86</td>\n",
       "      <td>240.99</td>\n",
       "      <td>371.25</td>\n",
       "      <td>415.73</td>\n",
       "      <td>88.32</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Chuzhou</th>\n",
       "      <td>316.58</td>\n",
       "      <td>441.70</td>\n",
       "      <td>318.24</td>\n",
       "      <td>257.07</td>\n",
       "      <td>84.02</td>\n",
       "      <td>220.54</td>\n",
       "      <td>422.21</td>\n",
       "      <td>216.86</td>\n",
       "      <td>222.48</td>\n",
       "      <td>257.33</td>\n",
       "      <td>...</td>\n",
       "      <td>103.02</td>\n",
       "      <td>365.07</td>\n",
       "      <td>100.53</td>\n",
       "      <td>31.23</td>\n",
       "      <td>200.66</td>\n",
       "      <td>151.01</td>\n",
       "      <td>289.82</td>\n",
       "      <td>211.12</td>\n",
       "      <td>235.62</td>\n",
       "      <td>454.46</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>suzhou</th>\n",
       "      <td>87.81</td>\n",
       "      <td>208.50</td>\n",
       "      <td>132.50</td>\n",
       "      <td>80.26</td>\n",
       "      <td>200.56</td>\n",
       "      <td>92.24</td>\n",
       "      <td>207.50</td>\n",
       "      <td>308.61</td>\n",
       "      <td>452.27</td>\n",
       "      <td>372.35</td>\n",
       "      <td>...</td>\n",
       "      <td>146.13</td>\n",
       "      <td>254.14</td>\n",
       "      <td>335.38</td>\n",
       "      <td>203.79</td>\n",
       "      <td>431.97</td>\n",
       "      <td>263.98</td>\n",
       "      <td>117.54</td>\n",
       "      <td>24.61</td>\n",
       "      <td>335.10</td>\n",
       "      <td>334.80</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>zhenjiang</th>\n",
       "      <td>219.81</td>\n",
       "      <td>354.13</td>\n",
       "      <td>256.08</td>\n",
       "      <td>192.27</td>\n",
       "      <td>120.45</td>\n",
       "      <td>117.50</td>\n",
       "      <td>349.14</td>\n",
       "      <td>269.30</td>\n",
       "      <td>308.19</td>\n",
       "      <td>250.96</td>\n",
       "      <td>...</td>\n",
       "      <td>0.00</td>\n",
       "      <td>338.59</td>\n",
       "      <td>200.13</td>\n",
       "      <td>76.93</td>\n",
       "      <td>288.80</td>\n",
       "      <td>133.54</td>\n",
       "      <td>231.02</td>\n",
       "      <td>121.54</td>\n",
       "      <td>293.30</td>\n",
       "      <td>428.24</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Jinhua</th>\n",
       "      <td>294.22</td>\n",
       "      <td>278.94</td>\n",
       "      <td>138.50</td>\n",
       "      <td>173.90</td>\n",
       "      <td>283.55</td>\n",
       "      <td>344.43</td>\n",
       "      <td>194.88</td>\n",
       "      <td>251.38</td>\n",
       "      <td>572.67</td>\n",
       "      <td>589.50</td>\n",
       "      <td>...</td>\n",
       "      <td>338.59</td>\n",
       "      <td>0.00</td>\n",
       "      <td>440.83</td>\n",
       "      <td>341.34</td>\n",
       "      <td>549.23</td>\n",
       "      <td>471.74</td>\n",
       "      <td>139.44</td>\n",
       "      <td>263.87</td>\n",
       "      <td>267.54</td>\n",
       "      <td>90.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Bengbu</th>\n",
       "      <td>416.88</td>\n",
       "      <td>541.62</td>\n",
       "      <td>412.11</td>\n",
       "      <td>353.07</td>\n",
       "      <td>161.33</td>\n",
       "      <td>316.51</td>\n",
       "      <td>518.50</td>\n",
       "      <td>241.65</td>\n",
       "      <td>131.94</td>\n",
       "      <td>266.37</td>\n",
       "      <td>...</td>\n",
       "      <td>200.13</td>\n",
       "      <td>440.83</td>\n",
       "      <td>0.00</td>\n",
       "      <td>131.58</td>\n",
       "      <td>108.59</td>\n",
       "      <td>194.00</td>\n",
       "      <td>383.17</td>\n",
       "      <td>311.65</td>\n",
       "      <td>251.12</td>\n",
       "      <td>527.30</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Nanjing</th>\n",
       "      <td>286.05</td>\n",
       "      <td>410.45</td>\n",
       "      <td>288.48</td>\n",
       "      <td>226.77</td>\n",
       "      <td>68.93</td>\n",
       "      <td>193.49</td>\n",
       "      <td>391.65</td>\n",
       "      <td>214.35</td>\n",
       "      <td>253.09</td>\n",
       "      <td>266.13</td>\n",
       "      <td>...</td>\n",
       "      <td>76.93</td>\n",
       "      <td>341.34</td>\n",
       "      <td>131.58</td>\n",
       "      <td>0.00</td>\n",
       "      <td>231.49</td>\n",
       "      <td>153.20</td>\n",
       "      <td>260.32</td>\n",
       "      <td>180.13</td>\n",
       "      <td>235.52</td>\n",
       "      <td>431.26</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Suzhou</th>\n",
       "      <td>508.59</td>\n",
       "      <td>640.24</td>\n",
       "      <td>517.98</td>\n",
       "      <td>457.54</td>\n",
       "      <td>269.52</td>\n",
       "      <td>398.46</td>\n",
       "      <td>622.82</td>\n",
       "      <td>339.34</td>\n",
       "      <td>23.49</td>\n",
       "      <td>257.18</td>\n",
       "      <td>...</td>\n",
       "      <td>288.80</td>\n",
       "      <td>549.23</td>\n",
       "      <td>108.59</td>\n",
       "      <td>231.49</td>\n",
       "      <td>0.00</td>\n",
       "      <td>233.58</td>\n",
       "      <td>489.26</td>\n",
       "      <td>407.57</td>\n",
       "      <td>344.27</td>\n",
       "      <td>635.23</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>huaian</th>\n",
       "      <td>317.38</td>\n",
       "      <td>461.82</td>\n",
       "      <td>385.97</td>\n",
       "      <td>322.75</td>\n",
       "      <td>221.65</td>\n",
       "      <td>195.78</td>\n",
       "      <td>471.49</td>\n",
       "      <td>366.35</td>\n",
       "      <td>245.23</td>\n",
       "      <td>118.00</td>\n",
       "      <td>...</td>\n",
       "      <td>133.54</td>\n",
       "      <td>471.74</td>\n",
       "      <td>194.00</td>\n",
       "      <td>153.20</td>\n",
       "      <td>233.58</td>\n",
       "      <td>0.00</td>\n",
       "      <td>362.37</td>\n",
       "      <td>241.07</td>\n",
       "      <td>386.14</td>\n",
       "      <td>561.57</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Hangzhou</th>\n",
       "      <td>157.76</td>\n",
       "      <td>189.52</td>\n",
       "      <td>29.18</td>\n",
       "      <td>40.26</td>\n",
       "      <td>224.21</td>\n",
       "      <td>209.62</td>\n",
       "      <td>138.50</td>\n",
       "      <td>272.30</td>\n",
       "      <td>511.65</td>\n",
       "      <td>476.91</td>\n",
       "      <td>...</td>\n",
       "      <td>231.02</td>\n",
       "      <td>139.44</td>\n",
       "      <td>383.17</td>\n",
       "      <td>260.32</td>\n",
       "      <td>489.26</td>\n",
       "      <td>362.37</td>\n",
       "      <td>0.00</td>\n",
       "      <td>131.58</td>\n",
       "      <td>296.67</td>\n",
       "      <td>217.31</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Wuxi</th>\n",
       "      <td>107.97</td>\n",
       "      <td>233.06</td>\n",
       "      <td>149.95</td>\n",
       "      <td>92.00</td>\n",
       "      <td>180.83</td>\n",
       "      <td>80.86</td>\n",
       "      <td>230.70</td>\n",
       "      <td>296.58</td>\n",
       "      <td>427.81</td>\n",
       "      <td>351.01</td>\n",
       "      <td>...</td>\n",
       "      <td>121.54</td>\n",
       "      <td>263.87</td>\n",
       "      <td>311.65</td>\n",
       "      <td>180.13</td>\n",
       "      <td>407.57</td>\n",
       "      <td>241.07</td>\n",
       "      <td>131.58</td>\n",
       "      <td>0.00</td>\n",
       "      <td>323.09</td>\n",
       "      <td>347.28</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Anqing</th>\n",
       "      <td>418.88</td>\n",
       "      <td>486.19</td>\n",
       "      <td>321.41</td>\n",
       "      <td>292.75</td>\n",
       "      <td>173.31</td>\n",
       "      <td>382.50</td>\n",
       "      <td>425.02</td>\n",
       "      <td>26.51</td>\n",
       "      <td>366.59</td>\n",
       "      <td>491.41</td>\n",
       "      <td>...</td>\n",
       "      <td>293.30</td>\n",
       "      <td>267.54</td>\n",
       "      <td>251.12</td>\n",
       "      <td>235.52</td>\n",
       "      <td>344.27</td>\n",
       "      <td>386.14</td>\n",
       "      <td>296.67</td>\n",
       "      <td>323.09</td>\n",
       "      <td>0.00</td>\n",
       "      <td>333.78</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>Lishui</th>\n",
       "      <td>361.50</td>\n",
       "      <td>312.30</td>\n",
       "      <td>207.70</td>\n",
       "      <td>255.49</td>\n",
       "      <td>372.19</td>\n",
       "      <td>426.66</td>\n",
       "      <td>223.14</td>\n",
       "      <td>322.16</td>\n",
       "      <td>658.70</td>\n",
       "      <td>679.22</td>\n",
       "      <td>...</td>\n",
       "      <td>428.24</td>\n",
       "      <td>90.26</td>\n",
       "      <td>527.30</td>\n",
       "      <td>431.26</td>\n",
       "      <td>635.23</td>\n",
       "      <td>561.57</td>\n",
       "      <td>217.31</td>\n",
       "      <td>347.28</td>\n",
       "      <td>333.78</td>\n",
       "      <td>0.00</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>26 rows × 26 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "             Shanghai  Zhoushan  Shaoxing  Huzhou  Maanshan  Nantong  ningbo  \\\n",
       "Shanghai         0.00    145.84    156.19  136.34    288.14   121.87  180.37   \n",
       "Zhoushan       145.84      0.00    165.81  200.50    394.74   267.26   89.17   \n",
       "Shaoxing       156.19    165.81      0.00   63.84    253.38   224.34  109.58   \n",
       "Huzhou         136.34    200.50     63.84    0.00    197.79   171.30  165.46   \n",
       "Maanshan       288.14    394.74    253.38  197.79      0.00   220.80  361.66   \n",
       "Nantong        121.87    267.26    224.34  171.30    220.80     0.00  288.06   \n",
       "ningbo         180.37     89.17    109.58  165.46    361.66   288.06    0.00   \n",
       "chizou         392.51    461.78    297.58  267.15    150.08   356.50  402.42   \n",
       "Huaibei        527.73    660.70    540.29  479.52    292.61   416.00  644.67   \n",
       "Lianyungang    412.91    558.70    499.18  436.86    335.04   292.72  578.45   \n",
       "yancheng       258.08    403.60    359.28  300.56    261.47   140.59  428.66   \n",
       "Huainan        466.32    584.13    444.70  389.36    191.73   372.37  553.34   \n",
       "Taizhou        210.06    350.13    267.14  204.21    153.52    96.94  353.52   \n",
       "Wenzhou        359.15    275.66    221.57  281.23    431.87   445.42  191.49   \n",
       "Chuzhou        316.58    441.70    318.24  257.07     84.02   220.54  422.21   \n",
       "suzhou          87.81    208.50    132.50   80.26    200.56    92.24  207.50   \n",
       "zhenjiang      219.81    354.13    256.08  192.27    120.45   117.50  349.14   \n",
       "Jinhua         294.22    278.94    138.50  173.90    283.55   344.43  194.88   \n",
       "Bengbu         416.88    541.62    412.11  353.07    161.33   316.51  518.50   \n",
       "Nanjing        286.05    410.45    288.48  226.77     68.93   193.49  391.65   \n",
       "Suzhou         508.59    640.24    517.98  457.54    269.52   398.46  622.82   \n",
       "huaian         317.38    461.82    385.97  322.75    221.65   195.78  471.49   \n",
       "Hangzhou       157.76    189.52     29.18   40.26    224.21   209.62  138.50   \n",
       "Wuxi           107.97    233.06    149.95   92.00    180.83    80.86  230.70   \n",
       "Anqing         418.88    486.19    321.41  292.75    173.31   382.50  425.02   \n",
       "Lishui         361.50    312.30    207.70  255.49    372.19   426.66  223.14   \n",
       "\n",
       "             chizou  Huaibei  Lianyungang  ...  zhenjiang  Jinhua  Bengbu  \\\n",
       "Shanghai     392.51   527.73       412.91  ...     219.81  294.22  416.88   \n",
       "Zhoushan     461.78   660.70       558.70  ...     354.13  278.94  541.62   \n",
       "Shaoxing     297.58   540.29       499.18  ...     256.08  138.50  412.11   \n",
       "Huzhou       267.15   479.52       436.86  ...     192.27  173.90  353.07   \n",
       "Maanshan     150.08   292.61       335.04  ...     120.45  283.55  161.33   \n",
       "Nantong      356.50   416.00       292.72  ...     117.50  344.43  316.51   \n",
       "ningbo       402.42   644.67       578.45  ...     349.14  194.88  518.50   \n",
       "chizou         0.00   362.14       473.87  ...     269.30  251.38  241.65   \n",
       "Huaibei      362.14     0.00       258.24  ...     308.19  572.67  131.94   \n",
       "Lianyungang  473.87   258.24         0.00  ...     250.96  589.50  266.37   \n",
       "yancheng     411.55   337.74       155.95  ...     145.01  466.61  278.14   \n",
       "Huainan      230.22   133.97       322.40  ...     254.91  455.20   62.83   \n",
       "Taizhou      302.26   319.74       232.93  ...      33.07  359.84  220.82   \n",
       "Wenzhou      401.86   723.42       717.44  ...     468.98  153.25  591.50   \n",
       "Chuzhou      216.86   222.48       257.33  ...     103.02  365.07  100.53   \n",
       "suzhou       308.61   452.27       372.35  ...     146.13  254.14  335.38   \n",
       "zhenjiang    269.30   308.19       250.96  ...       0.00  338.59  200.13   \n",
       "Jinhua       251.38   572.67       589.50  ...     338.59    0.00  440.83   \n",
       "Bengbu       241.65   131.94       266.37  ...     200.13  440.83    0.00   \n",
       "Nanjing      214.35   253.09       266.13  ...      76.93  341.34  131.58   \n",
       "Suzhou       339.34    23.49       257.18  ...     288.80  549.23  108.59   \n",
       "huaian       366.35   245.23       118.00  ...     133.54  471.74  194.00   \n",
       "Hangzhou     272.30   511.65       476.91  ...     231.02  139.44  383.17   \n",
       "Wuxi         296.58   427.81       351.01  ...     121.54  263.87  311.65   \n",
       "Anqing        26.51   366.59       491.41  ...     293.30  267.54  251.12   \n",
       "Lishui       322.16   658.70       679.22  ...     428.24   90.26  527.30   \n",
       "\n",
       "             Nanjing  Suzhou  huaian  Hangzhou    Wuxi  Anqing  Lishui  \n",
       "Shanghai      286.05  508.59  317.38    157.76  107.97  418.88  361.50  \n",
       "Zhoushan      410.45  640.24  461.82    189.52  233.06  486.19  312.30  \n",
       "Shaoxing      288.48  517.98  385.97     29.18  149.95  321.41  207.70  \n",
       "Huzhou        226.77  457.54  322.75     40.26   92.00  292.75  255.49  \n",
       "Maanshan       68.93  269.52  221.65    224.21  180.83  173.31  372.19  \n",
       "Nantong       193.49  398.46  195.78    209.62   80.86  382.50  426.66  \n",
       "ningbo        391.65  622.82  471.49    138.50  230.70  425.02  223.14  \n",
       "chizou        214.35  339.34  366.35    272.30  296.58   26.51  322.16  \n",
       "Huaibei       253.09   23.49  245.23    511.65  427.81  366.59  658.70  \n",
       "Lianyungang   266.13  257.18  118.00    476.91  351.01  491.41  679.22  \n",
       "yancheng      201.52  326.11   92.58    340.64  209.49  434.46  553.44  \n",
       "Huainan       181.09  112.43  256.58    415.52  359.15  233.10  537.71  \n",
       "Taizhou       106.11  301.81  119.01    244.11  122.82  326.35  448.61  \n",
       "Wenzhou       484.59  700.10  601.86    240.99  371.25  415.73   88.32  \n",
       "Chuzhou        31.23  200.66  151.01    289.82  211.12  235.62  454.46  \n",
       "suzhou        203.79  431.97  263.98    117.54   24.61  335.10  334.80  \n",
       "zhenjiang      76.93  288.80  133.54    231.02  121.54  293.30  428.24  \n",
       "Jinhua        341.34  549.23  471.74    139.44  263.87  267.54   90.26  \n",
       "Bengbu        131.58  108.59  194.00    383.17  311.65  251.12  527.30  \n",
       "Nanjing         0.00  231.49  153.20    260.32  180.13  235.52  431.26  \n",
       "Suzhou        231.49    0.00  233.58    489.26  407.57  344.27  635.23  \n",
       "huaian        153.20  233.58    0.00    362.37  241.07  386.14  561.57  \n",
       "Hangzhou      260.32  489.26  362.37      0.00  131.58  296.67  217.31  \n",
       "Wuxi          180.13  407.57  241.07    131.58    0.00  323.09  347.28  \n",
       "Anqing        235.52  344.27  386.14    296.67  323.09    0.00  333.78  \n",
       "Lishui        431.26  635.23  561.57    217.31  347.28  333.78    0.00  \n",
       "\n",
       "[26 rows x 26 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "city_26 = generate_city_26()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
